package org.shiki.hrm.fein;

import feign.hystrix.FallbackFactory;
import org.shiki.hrm.domain.LoginUser;
import org.shiki.hrm.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class LoginUserFallbackFactory implements FallbackFactory<LoginUserFeignClient> {
	@Override
	public LoginUserFeignClient create(Throwable throwable) {
		return new LoginUserFeignClient() {
			@Override
			public AjaxResult entrying(LoginUser loginUser) {
				return AjaxResult.me().setSuccess(false).setMessage("网络异常!");
			}
		};
	}
}
